package main

import (
	"fmt"
	"math/rand"
	"time"
)

func main() {
	i := 0
	for {
		i++
		if i > 10 {
			break
		}
		go testFallthrough(t1)
		//time.Sleep(time.Second * 1)
	}
	time.Sleep(time.Second * 1)

}

type TestType uint8

const (
	t1 TestType = iota
	t2
	t3
	t4
)

func testFallthrough(tt TestType) {
	resT := tt
RANDOM:
	switch resT {
	case t1:
		list := []TestType{t2, t3, t4}
		//rand.Seed(time.Now().Unix())
		index := rand.Intn(3)
		typeStr := list[index]
		resT = typeStr
		goto RANDOM
	case t2:
		fmt.Println("T2 。。。")
	case t3:
		fmt.Println("T3 。。。")
	case t4:
		fmt.Println("T4 。。。")
	default:
		fmt.Println("error:??")
	}
}
